package topcoder;


public class ExerciseMachine {

	private  int gcd(int p,int q)
	{
		if(p>q){
			int tmp=p;
			p=q;
			q=tmp;
		}
		int mod=q%p;
		if(mod==0)return p;
		return gcd(mod,p);
	}
	
	public int getPercentages(String time)
	{
		int sec=0;
		String st[]=time.split(":");
		try{
			sec+=Integer.parseInt(st[0])*3600;
			sec+=Integer.parseInt(st[1])*60;
			sec+=Integer.parseInt(st[2]);
		}catch (Exception e) {
			e.printStackTrace();
		}
		return gcd(sec,100)-1;
	}
	
}
